:: file        git_pull_xml.bat
:: brief       XXXX
:: note        XXXX
:: author      靳普诏(puzhao.jin@hopechart.com)
:: date        2025/04/09
:: version     1.0

@echo off
setlocal EnableDelayedExpansion
:: ============================= 获取环境参数 ================================

set ARGV_LEN=%#
::echo "There are %ARGV_LEN% arguments passed to the git_pull_xml.bat"

set i=1
:show_argument
if %i% gtr %ARGV_LEN% goto end_show_argument

set arg=!%i%!
::echo "Argument %i%: %arg%"

set /a i+=1
goto show_argument

:end_show_argument
::echo "All arguments printed"

:: 脚本所在路径
set SCRIPT_DIR=%~dp0
echo "SCRIPT_DIR=%SCRIPT_DIR%"
:: 当前工作路径
set CURRENT_DIR=%cd%
echo "CURRENT_DIR=%CURRENT_DIR%"    

:: ============================= 实际调用逻辑 ================================
echo "============= BIGEN: git_pull_xml.bat ============="


:: 用于调用git_pull_xml.py脚本
set PYTHON_EXE=python.exe
set PYTHON_SCRIPT=git_pull_xml.py
set PYTHON_SCRIPT_PATH=%SCRIPT_DIR%/../code/%PYTHON_SCRIPT%

:: 调用git_pull_xml.py脚本
%PYTHON_EXE% %PYTHON_SCRIPT_PATH% %*

:: 脚本返回值
set SCRIPT_RETURN=%errorlevel%
echo "SCRIPT_RETURN=%SCRIPT_RETURN%"


echo "============= END: git_pull_xml.bat ============="
echo "git_pull_xml.bat return errorlevel:%errorlevel%"

pause
endlocal


